#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
/**
 * DTExtensions for reading value at index
 */
@interface NSArray (ArleneExtensions)

@property(nonatomic, readonly, assign) NSUInteger count;

- (id)objectOrNilAtIndex:(NSUInteger)index;

- (BOOL)containsIndex:(NSUInteger)index;

@end

@interface ArleneNode : NSObject <NSFastEnumeration>

@property (nonatomic, weak) __kindof ArleneNode *parent;
@property (nonatomic, strong) __kindof NSArray <__kindof ArleneNode *> *children;

- (void)addChild:(__kindof ArleneNode *)node;

- (void)addChildFromArray:(NSArray <__kindof ArleneNode *> *)array;

- (void)insertChild:(__kindof ArleneNode *)node atIndex:(NSUInteger)index;

- (void)removeChild:(__kindof ArleneNode *)node;

- (void)removeFromParent;

- (void)removeAllChild;

- (NSUInteger)nodeIndex;

- (__kindof ArleneNode *)firstChild;

- (__kindof ArleneNode *)lastChild;

- (NSArray <__kindof ArleneNode *> *)siblings;

- (BOOL)isLastChild;

- (BOOL)isFirstChild;

- (__kindof ArleneNode *)nextSibling;

- (__kindof ArleneNode *)previousSibling;

- (NSUInteger)count;

- (__kindof ArleneNode *)objectAtIndex:(NSUInteger)idx;

@end

NS_ASSUME_NONNULL_END
